    window.onload = function() {
        let methods = document.querySelectorAll('.method')
        let pages = document.querySelectorAll('.page')
        console.log(methods);
        methods.forEach(function(m, index) {
            m.addEventListener('click', function() {
                methods.forEach(function(m) {
                    m.classList.remove('active')
                })
                this.classList.add('active')
                pages.forEach(function(p) {
                    p.classList.remove('on')
                })
                pages[index].classList.add('on')

            })
        })




        function login() {
            let username = document.querySelector('.username')
            let pas = document.querySelector('.pas')
            let btn = document.querySelector('.btn')
            btn.addEventListener('click', function() {
                if (username.value !== 'zs') {
                    return alert('账号或密码错误')
                }
                if (pas.value !== '123') {
                    return alert('账号或密码错误')
                }
                alert('登录成功')
                setTimeout(function() {
                    location.href = `./首页.html?username=zs`
                }, 1000)
            })
        }
        login()

    }